package com.zjj.algorithm.learning.niuke;

import java.util.Scanner;

/**
 * @author zjj_admin
 * @date 2023/2/10 20:15
 */
public class Exam2 {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String s1 = scanner.nextLine();
        String[] split1 = s1.split(" ");
        int y = Integer.parseInt(split1[0]);
        int x = Integer.parseInt(split1[1]);
        int len = Integer.parseInt(split1[2]);
        int need = Integer.parseInt(split1[3]);
        int a = 0;
        int[][] nums = new int[y][x];
        String data;
        while (a < y) {
            data = scanner.nextLine();
            String[] datas = data.split(" ");
            for (int i = 0; i < datas.length; i++) {
                nums[a][i] = Integer.parseInt(datas[i]);
            }
            a++;
        }
        int res = 0;
        for (int i = 0; i < nums[0].length && i + len <= x; i++) {
            for (int j = 0; j < nums.length && j + len <= y; j++) {
                //计算矩阵中的值
                int num = 0;
                for (int m = i; m < i + len; m++) {
                    for (int n = j; n < j + len; n++) {
                        int b = nums[n][m];
                        num += nums[n][m];
                    }
                }
                if (num >= need) {
                    res++;
                }
            }
        }
        System.out.println(res);


    }
}
